<%--
  Created by IntelliJ IDEA.
  User: zhanchi
  Date: 2016/6/14
  Time: 14:25
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- START DEFAULT DATATABLE -->
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">订单信息</h3>
    </div>
    <style>
        .panel-heading ul, .panel-heading ul li {
            float: left;
            list-style: none;
        }

        li .Wdate {
            height: 30px;
            width: 90px;
        }

        .panel-heading li {
            margin: 0 10px;
        }

        .panel-heading li, .panel-heading li select {
            height: 30px;
            line-height: 30px;
        }
    </style>
    <div class="panel-heading">
        <form action="info.jspx" method="get">
            <ul>
                <li>已完成订单</li>
                <li>开始日期</li>
                <li><input name="begin" value="" class="Wdate" type="text" id="i1"
                           onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></li>
                <li>结束日期</li>
                <li><input name="end" class="Wdate" type="text" value="" id="i2"
                           onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></li>
                <%--<li><input class="form-control" style="width: 60px" type="submit" value="查 询" /></li>--%>
                <li><input class="form-control" type="button" value="导出订单" id="group-export" onclick="exportOrder()"/></li>
            </ul>
        </form>
    </div>
</div>
<div id="ifm"></div>
<script>
    var isDo = 0;
    function exportOrder() {
        if (isDo == 1)
            return;
        var dd = $("input[name=begin]").val();
        var st = $("input[name=end]").val();
        var b = dd,e = st;
        if (b != '' && e != '') {
            isDo = 1;
            $("#group-export").html("正在导出 ... ");
            $('#ifm').html('<iframe id="downFrame" name="downFrame" width="0" height="0" src="'+
                    '/admin/order/financeExport.jspx?begin=' + b + '&end=' + e + '"></iframe>');
//            $("#downFrame").attr("src", "/admin/statistics/downOrder.jspx?type=fin&arrive=" + a + "&t=" + (new Date()));
            isDo = 0;
        }
    }
    function downFrameOver() {
        isDo = 0;
        $("#group-export").html("导出订单");
    }
    $(function(){
        var now = new Date();
        var year = now.getFullYear();
        var month = now.getMonth()+1;
        var days = now.getDate()
        if(month<10) month = "0"+month;
        if(days<10)  days = "0"+days;
        var tm = year+"-"+month+"-"+days;
        $("#i1").prop("value",tm);
        $("#i2").prop("value",tm);
    });
</script>
<script src="/statics/admin/js/My97DatePicker/WdatePicker.js"></script>

